<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <script !src="">
    let obj = {
      name: "王大花",
      age: 20,
      sex: 'female',
      address: '上海'
    };
    let {age,name,sex} = obj;
    console.log(age, name, sex);
    let responseData = {
      code:200,
      data:{
        id:1,
        title:'吃饭',
        isDone:true
      }
    }
    let {code, data:{id,title}} = responseData
    console.log(code,id,title);

    // 数组的解构: 跟位置有关
    let arr = [1,2,3,4];
    let [a,b,c,d] = arr;
    console.log(b,c);

    // 扩展运算 ... 脱衣服      {...obj}   [...arr]

  </script>
</body>
</html>